﻿@{
    ViewBag.Title = "Index";
    Layout = ViewBag.Layout;
}
@using CNKI.TPI.Web.Base
@using CNKI.TPI.Web.Admin.Model;
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
<script>
    $(function () {
        //异步加载左侧信息
        var len = $('#NumLeft').val();
        for (var i = 0; i < len; i++) {
            var str = "#UpdateCatLinkNew" + i;
            $(str).click();
        }
        //异步加载右侧信息
        var len = $('#NumRight').val();
        for (var i = 0; i < len; i++) {
            var str = "#UpdateCatLinkH" + i;
            $(str).click();
        }
    })

</script>

<!-- 焦点图 -->
<div class="wrap" style="margin-bottom:20px;">
    <div class="banner">
        <img src="@ViewBag.TitlePic" alt="" />
    </div>
    @using (Html.BeginForm("Index", "TopicMultiSearch", new {TopicCode = 1 }, FormMethod.Post, new { @class = "search search-stg03", id = "searchForm" }))
    {
        <div class="serach">
            <input type="hidden" id="conditionKey" name="conditionKey" value="题名" />
            <input type="hidden" id="conditionStr" name="conditionStr" value="题名" />
            <input type="hidden" id="currentClassID" name="currentClassID" value="ALL" />
            <input type="hidden" id="checkDatabaseID" name="checkDatabaseID" value="@ViewBag.DBID" />
            <input type="text" id="searchField" name="searchField" />
            <button type="submit" id="searchBtn">检索</button>
        </div>
    }

</div>
<div class="wrap clearfix">
    <input type="hidden" id="NumLeft" name="NumLeft" value="@ViewBag.NumLeft" />
    <input type="hidden" id="NumRight" name="NumRight" value="@ViewBag.NumRight" />
    <!-- 左侧 -->
    <div class="index-l fl">
        @{
            int j = 0;
            foreach (SYS_CMS_TOPIC_PAGECONFIG item in @ViewBag.LeftList)
            {
                string stridnew = "updatedinfo" + j;
                var ajaxOptions = new AjaxOptions()
                {
                    HttpMethod = "post",
                    UpdateTargetId = stridnew,
                    InsertionMode = InsertionMode.Replace
                };

                @Ajax.ActionLink("隐藏域1", "SubTopicPage",
                                new
                                {
                                    dbCode = item.DBCode,
                                    nodeSysCode = item.NodeCode,
                                    clsCode = item.CLSCode,
                                    len = item.ArticleLength,
                                    pageSize = item.ArticleNum,
                                    topiccode = ViewBag.TopicCode,
                                    showtype = item.ShowType
                                },
                                ajaxOptions, new { id = "UpdateCatLinkNew" + j, hidden = "hidden", style = "display:none" })

                if (item.ShowType == 4)//焦点图
                {
                    <div class="slider">
                        <div class="sliderInner" id="@stridnew">
                            <img src="~/Images/loading.gif" width="50" />
                        </div>
                    </div>
                }
                else if (item.ShowType == 1)//文章
                {
                    <div class="mb5">
                        <h2 class="ht">
                            <span class="fl">@item.ColumnName</span>
                            <a target="_blank" href="~/TopicSingleSearch?name=@item.DBCode&TopicCode=@ViewBag.TopicCode&displayDBName=@Server.UrlEncode(item.DBName)&topicCLSCode=@item.CLSCode&topicCLSNodeCode=@item.NodeCode&autoLoad=1" class="more">更多></a>
                        </h2>
                        <ul class="list-tpi" id="@stridnew">
                            <img src="~/Images/loading.gif" width="50" />
                        </ul>
                    </div>
                }
                else if (item.ShowType == 2)//画作
                {
                    <div class="mb5">
                        <h2 class="ht">
                            <span class="fl">@item.ColumnName</span>
                            <a target="_blank" href="~/TopicSingleSearch?name=@item.DBCode&TopicCode=@ViewBag.TopicCode&displayDBName=@Server.UrlEncode(item.DBName)&topicCLSCode=@item.CLSCode&topicCLSNodeCode=@item.NodeCode&autoLoad=1" class="more">更多></a>
                        </h2>
                        <ul class="list-dl-01 clearfix" id="@stridnew">
                            <img src="~/Images/loading.gif" width="50" />
                        </ul>
                    </div>
                }
                else if (item.ShowType == 3)//文学作品
                {

                    <div class="mb5">
                        <h2 class="ht">
                            <span class="fl">@item.ColumnName</span>
                            <a target="_blank" href="~/TopicSingleSearch?name=@item.DBCode&TopicCode=@ViewBag.TopicCode&displayDBName=@Server.UrlEncode(item.DBName)&topicCLSCode=@item.CLSCode&topicCLSNodeCode=@item.NodeCode&autoLoad=1" class="more">更多></a>
                        </h2>
                        <ul class="list-dl clearfix" id="@stridnew">
                            <img src="~/Images/loading.gif" width="50" />
                        </ul>
                    </div>
                }
                j++;
            }
        }

    </div>
    <!-- 右侧 -->
    <div class="index-r fr">
        @{
            int i = 0;
            foreach (SYS_CMS_TOPIC_PAGECONFIG item in @ViewBag.RightList)
            {
                string stridnew = "updatedinfoR" + i;
                var ajaxOptions = new AjaxOptions()
                {
                    HttpMethod = "post",
                    UpdateTargetId = stridnew,
                    InsertionMode = InsertionMode.Replace
                };

                @Ajax.ActionLink("隐藏域1", "SubTopicPage",
                                new
                                {
                                    dbCode = item.DBCode,
                                    nodeSysCode = item.NodeCode,
                                    clsCode = item.CLSCode,
                                    len = item.ArticleLength,
                                    pageSize = item.ArticleNum,
                                    topiccode = ViewBag.TopicCode,
                                    showtype = item.ShowType
                                },
                                ajaxOptions, new { id = "UpdateCatLinkH" + i, hidden = "hidden", style = "display:none" })

                if (item.ShowType == 5)//简介
                {
                <!-- 列表1 -->
                    <div class="mb25 h">
                        <h2 class="ht-r">
                            <a href="javascript:void()" style="cursor:default" title="@item.ColumnName">
                                <span class="fl ht-span">@ColumnAliasHelper.SubContent(@item.ColumnName, 8)<i class="ht-bj"></i></span>
                            </a>
                        </h2>
                        <div id="@stridnew">
                            <img src="~/Images/loading.gif" width="50" />
                        </div>

                    </div>

                }
                else if (item.ShowType == 6)//影视资料
                {
                    <div class="mb25">
                        <h2 class="ht-r">
                            <a href="javascript:void()" style="cursor:default" title="@item.ColumnName">
                                <span class="fl ht-span">@ColumnAliasHelper.SubContent(@item.ColumnName, 8)<i class="ht-bj"></i></span>
                            </a>
                            <a target="_blank" href="~/TopicSingleSearch?name=@item.DBCode&TopicCode=@ViewBag.TopicCode&displayDBName=@Server.UrlEncode(item.DBName)&topicCLSCode=@item.CLSCode&topicCLSNodeCode=@item.NodeCode&autoLoad=1" class="more">更多></a>
                        </h2>
                        <div id="@stridnew">

                            <img src="~/Images/loading.gif" width="50" />
                        </div>
                    </div>
                }
                else if (item.ShowType == 7)//艺术家风采
                {
                    <script src="~/Content/Topic/js/index.js?jv=1"></script>

                <!-- 列表1 -->
                    <div class="mb25">
                        <h2 class="ht-r">
                            <a href="javascript:void()" style="cursor:default" title="@item.ColumnName">
                                <span class="fl ht-span">@ColumnAliasHelper.SubContent(@item.ColumnName, 8)<i class="ht-bj"></i></span>
                            </a>
                            <a target="_blank" href="~/TopicSingleSearch?name=@item.DBCode&TopicCode=@ViewBag.TopicCode&displayDBName=@Server.UrlEncode(item.DBName)&topicCLSCode=@item.CLSCode&topicCLSNodeCode=@item.NodeCode&autoLoad=1" class="more">更多></a>
                        </h2>
                        <div class="posr">
                            <div class="photo">
                                <div class="photo-box">
                                    <ul id="@stridnew">
                                        <img src="~/Images/loading.gif" width="50" />
                                    </ul>
                                </div>
                            </div>
                            <div class="photo-btn">
                                <a class="photo-btn-l"></a>
                                <a class="photo-btn-r"></a>
                            </div>
                        </div>
                    </div>
                }
                i++;
            }
        }

    </div>
</div>